﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;
using TomatoSynchronizer.Store;

namespace TomatoSynchronizer.Entities 
{

    public class Translation 
    {

        public Translation()
        {
        }
        
        public override bool Equals(object obj)
		{
			if(obj is Translation)
			{
				Translation translation = (Translation)obj;
				if(translation._content_group == _content_group && translation._definition_key == _definition_key && translation._definition_value == _definition_value)
				{
					return true;
				}
			}
			
			return false;
		}

        public Translation(string json)
         : this(JObject.Parse(json))
        {
        }

        private JObject __jobject;
        public Translation(JObject obj)
        {
            this.__jobject = obj;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }        

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private int _languages_definitions_id;
        public int languages_definitions_id
        {
            get
            {
                if(_languages_definitions_id == null)
                    _languages_definitions_id = JsonClassHelper.ReadInteger(JsonClassHelper.GetJToken<JValue>(__jobject, "languages_definitions_id"));
                return _languages_definitions_id;
            }
            set
            {
                _languages_definitions_id = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _languages_id;
        public string languages_id
        {
            get
            {
                if(_languages_id == null)
                    _languages_id = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "languages_id"));
                return _languages_id;
            }
            set
            {
                _languages_id = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _definition_key;
        public string definition_key
        {
            get
            {
                if(_definition_key == null)
                    _definition_key = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "definition_key"));
                return _definition_key;
            }
            set
            {
                _definition_key = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _definition_value;
        public string definition_value
        {
            get
            {
                if(_definition_value == null)
                    _definition_value = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "definition_value"));
                return _definition_value;
            }
            set
            {
                _definition_value = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _content_group;
        public string content_group
        {
            get
            {
                if(_content_group == null)
                    _content_group = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "content_group"));
                return _content_group;
            }
            set
            {
                _content_group = value;
            }
        }

    }
}
